#!/usr/bin/env python
#Boa:App:BoaApp
import sys

import wx

from twisted.python import log
from twisted.internet import wxreactor
wxreactor.install()

# import t.i.reactor only after installing wxreactor:
from twisted.internet import reactor

from ui import Frame1

import os

modules ={'Frame1': [1, 'Main frame of Application', u'ui/Frame1.py']}

class BoaApp(wx.App):
    def OnInit(self):
        import os
        self.appRoot = os.getcwd() 
        wx.Locale.AddCatalogLookupPathPrefix(os.path.join(self.appRoot, 'locale'))
        self.locale = wx.Locale(wx.LANGUAGE_CHINESE_SIMPLIFIED)
        self.locale.AddCatalog('smgp')
        import __builtin__
        __builtin__.__dict__['_'] = wx.GetTranslation   
        
        self.main = Frame1.create(None)
        self.main.Show()
        self.SetTopWindow(self.main)
        return True

def main():
    application = BoaApp(0)
    reactor.registerWxApp(application)

    # start the event loop:
    reactor.run()

if __name__ == '__main__':
    main()
